[Feature] Enable get-token and bootstrap certificate from Key Vault#613
[Feature] Enable get-token and bootstrap certificate from Key Vault#613nchapagain001 wants to merge 29 commits intomainfrom
Conversation
Signed-off-by: Nirjan Chapagain <165215502+nchapagain001@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request adds two new features to Virtual Client: a get-token subcommand to retrieve Azure access tokens for Key Vault authentication, and enhanced bootstrap command functionality to support certificate installation from Azure Key Vault. The implementation allows users to either use default Azure credential flows or explicitly provide an access token for Key Vault operations.
Changes:
- Added
get-tokensubcommand that acquires Azure access tokens using interactive browser authentication with device-code fallback - Enhanced
bootstrapsubcommand to support certificate installation from Azure Key Vault in addition to package installation - Introduced new components
KeyVaultAccessTokenandCertificateInstallationfor token acquisition and certificate management
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 25 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/guides/0010-command-line.md | Documentation for new get-token subcommand and updated bootstrap command with certificate installation support |
| src/VirtualClient/VirtualClient.Main/Program.cs | Added get-token subcommand registration and bootstrap command validation for certificate operations |
| src/VirtualClient/VirtualClient.Main/OptionFactory.cs | Added --token and --cert-name command-line options |
| src/VirtualClient/VirtualClient.Main/GetAccessTokenCommand.cs | New command implementation for retrieving access tokens |
| src/VirtualClient/VirtualClient.Main/BootstrapPackageCommand.cs | Enhanced to support certificate installation alongside package installation |
| src/VirtualClient/VirtualClient.Main/InstallCertCommand.cs | Unused/orphaned command file that should be removed |
| src/VirtualClient/VirtualClient.Main/CommandBase.cs | Added ShouldInitializeKeyVault property to control Key Vault initialization |
| src/VirtualClient/VirtualClient.Main/profiles/GET-ACCESS-TOKEN.json | Profile definition for token acquisition workflow |
| src/VirtualClient/VirtualClient.Main/profiles/BOOTSTRAP-DEPENDENCIES.json | Updated to support both package and certificate installation |
| src/VirtualClient/VirtualClient.Dependencies/KeyVaultAccessToken.cs | Component for acquiring Azure access tokens with browser/device-code fallback |
| src/VirtualClient/VirtualClient.Dependencies/CertificateInstallation.cs | Component for installing certificates from Key Vault to local certificate stores |
| src/VirtualClient/VirtualClient.Core/Identity/AccessTokenCredential.cs | Token credential implementation for pre-acquired access tokens |
| src/VirtualClient/VirtualClient.Core/EndpointUtility.cs | Added method to parse tenant ID from URIs |
| src/VirtualClient/VirtualClient.Core/KeyVaultManager.cs | Removed unused using statement |
| src/VirtualClient/VirtualClient.Core/IKeyVaultManager.cs | Added missing System namespace import |
| src/VirtualClient/VirtualClient.TestFramework/MockFixture.cs | Added KeyVaultManager mock support for testing |
| src/VirtualClient/VirtualClient.UnitTests/*.cs | Unit tests for new commands and validation logic |
| src/VirtualClient/VirtualClient.Dependencies.UnitTests/*.cs | Unit tests for KeyVaultAccessToken and CertificateInstallation components |
| src/VirtualClient/VirtualClient.Core.UnitTests/EndpointUtilityTests.cs | Tests for tenant ID parsing functionality |
| src/VirtualClient/VirtualClient.Actions.FunctionalTests/GetAccessTokenProfileTests.cs | Functional tests for the GET-ACCESS-TOKEN profile |
| VERSION | Version bumped to 2.1.56 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/VirtualClient/VirtualClient.Main/profiles/BOOTSTRAP-DEPENDENCIES.json
Show resolved
Hide resolved
src/VirtualClient/VirtualClient.Dependencies/CertificateInstallation.cs
Outdated
Show resolved
Hide resolved
src/VirtualClient/VirtualClient.Dependencies.UnitTests/CertificateInstallationTests.cs
Show resolved
Hide resolved
…lation.cs copilot feedback Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nirjan Chapagain <165215502+nchapagain001@users.noreply.github.com>
|
@nchapagain001 I've opened a new pull request, #638, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nirjan Chapagain <165215502+nchapagain001@users.noreply.github.com>
|
@nchapagain001 I've opened a new pull request, #639, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@nchapagain001 I've opened a new pull request, #640, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nirjan Chapagain <165215502+nchapagain001@users.noreply.github.com>
…ntial.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nirjan Chapagain <165215502+nchapagain001@users.noreply.github.com>
* Initial plan * Add copyright header to CertificateInstallationTests.cs Co-authored-by: nchapagain001 <165215502+nchapagain001@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nchapagain001 <165215502+nchapagain001@users.noreply.github.com>
#639) * Initial plan * Fix incorrect class description in CertificateInstallation.cs Co-authored-by: nchapagain001 <165215502+nchapagain001@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nchapagain001 <165215502+nchapagain001@users.noreply.github.com>
* Initial plan * Clarify tenant ID requirement in get-token documentation Co-authored-by: nchapagain001 <165215502+nchapagain001@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nchapagain001 <165215502+nchapagain001@users.noreply.github.com>
In this PR, following changes have been made:
-> Adding subcommand to get-token.
-> In bootstrap, existing subcommand, we are enabling users to download certificate.
The example below shows how to get token and bootstrap certificate using the token.